﻿@model GameSchoolWeb.Models.AssignmentListModelView
<div id="templatemo_content">
    @{
        ViewBag.Title = "Búa til nýtt verkefni";
    }
    <div class="templatemo_box">
        @if (User.IsInRole("Kennari"))
        {
            <h2>
                Búa til nýtt verkefni</h2>

            <p>
                @Html.ActionLink("Búa til nýtt verkefni", "CreateAssignment", new { id = Model.lvlId })
            </p>
        }
        @if (User.IsInRole("Nemandi"))
        {
            <h2>
                Hér er listi yfir öll verkefni</h2>
        }
        <div class="body">
            <table>
                <tr>
                    <th>
                        Titill
                    </th>
                    <th>
                        Stig
                    </th>
                    <th>
                    </th>
                </tr>
                @foreach (var item in Model.assignments)
                {
                    <tr>
                        <td>
                            @Html.ActionLink(item.strTitle, "TurnInAssignment", new { id = item.id })
                        </td>
                        <td>
                            <strong>@Html.DisplayFor(motelItem => item.strValue)</strong>
                        </td>
                        @if (HttpContext.Current.User.IsInRole("Kennari"))
                        {
                            <td>
                                @Html.ActionLink("Sjá skiluð", "GetAllTurnedInAssignment", new { id = item.id })
                            </td>
                        }
                    </tr>
                }
            </table>
        </div>
        <div class="box_bottom">
            <span></span>
        </div>
    </div>
</div>
